﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using Flame.Dlr;

namespace Flame.Controls
{
    public static class CellHelper
    {

        /*public static string CellsToFlame(List<Cell> cells)
        {
            IronPython.Runtime.List pycells = new IronPython.Runtime.List();
            foreach (var c in cells)
            {
                IronPython.Runtime.PythonDictionary pycell = new IronPython.Runtime.PythonDictionary();
                pycell.Add("Code", c.Code);
                pycell.Add("Auto", c.Auto);
                pycell.Add("Language", c.Language);
                pycells.Add(pycell);
            }

            IronPythonExec x = new IronPythonExec();
            x.AddVariable(new Variable() { Name = "x", Data = pycells });
            var r = x.Execute("str(x)");
            return HeaderVersion + r.Data.ToString();
        }*/

        /*public static IEnumerable<BaseCell> FlameToCells(string text)
        {
            List<BaseCell> cells = new List<BaseCell>();
            IronPythonExec x = new IronPythonExec();


            AssemblyHelper.Apply(AssemblyHelper.CurrentFlameAssemblies, x);

            dynamic d = x.Execute(text);
            IronPython.Runtime.List pycells = d.Data;

            foreach (IronPython.Runtime.PythonDictionary pycell in pycells)
            {
                bool auto = false;
                if (pycell.has_key("Auto"))
                    auto = (bool)pycell.get("Auto");

                cells.Add((new Cell() { Auto = auto, Code = (string)pycell.get("Code"), Language = (string)pycell.get("Language") }).Base);
            }
            return cells;
        }*/
    }
}
